USE [Weval test]
GO

/****** Object:  StoredProcedure [dbo].[YearsSemestersTaught]    Script Date: 7/8/2013 7:22:59 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



CREATE PROCEDURE [dbo].[YearsSemestersTaught] @InstructorID int
AS
SELECT DISTINCT

	Semester,
	
	Year,
	
	ST.instructorID
	--SELECT * 
FROM SectionsTaught ST 
	INNER JOIN Results R ON R.sectionID = ST.sectionID
		AND ST.instructorID = @InstructorID
		AND (R.deleted = 0 OR R.deleted IS NULL)
	INNER JOIN CourseSections CS ON CS.ID = R.sectionID


GO

